import { S } from '../../s';
import { IPSDELogicLinkCond } from './ipsdelogic-link-cond';
import { IPSDELogicLinkGroupCond } from './ipsdelogic-link-group-cond';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDELogicLinkGroupCondImpl
  extends PSModelObjectImpl
  implements IPSDELogicLinkGroupCond
{
  get groupOP(): 'AND' | 'OR' {
    return this.M.groupOP;
  }

  get logicType(): 'GROUP' | 'SINGLE' {
    return this.M.logicType;
  }

  protected psdelogiclinkconds: IPSDELogicLinkCond[];
  getPSDELogicLinkConds(): IPSDELogicLinkCond[] | null {
    return (
      this.psdelogiclinkconds ||
      (this.psdelogiclinkconds = this.fillChildListModel(
        this.M.getPSDELogicLinkConds,
        S._29b,
      ) as IPSDELogicLinkCond[])
    );
  }

  findPSDELogicLinkCond(objKey: any): IPSDELogicLinkCond | null {
    return this.getPSModel5(
      S._29b,
      this.getPSDELogicLinkConds(),
      objKey,
    ) as IPSDELogicLinkCond;
  }

  get notMode(): boolean {
    return this.M.notMode != null ? this.M.notMode : false;
  }
  get cls(): string {
    return 'PSDELogicLinkGroupCondImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1d8) return true;
    return super.instanceof(cls);
  }
}
